package com.woniuxy.producerconsumer.controller;

import com.woniuxy.po.Mail;
import com.woniuxy.producerconsumer.service.PCService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class PCController {
    @Resource
    PCService pcService;
    @RequestMapping("produce")
    @ResponseBody
    public  void produce(@ModelAttribute("mail") Mail mail){
        pcService.sendMail("PCQueue",mail);
    }
}
